import { createRouter, createWebHashHistory } from "vue-router";
// const originalPush = Router.prototype.push;
// Router.prototype.push = function push(location) {
//   return originalPush.call(this, location).catch((err) => {
//     Vue.prototype.$NProgress.done();
//   });
// };

let routes = [
  {
    path: "/",
    redirect: "/shishijiangyu",
  },
  {
    path: "/",
    component: () => import("../components/common/Home.vue"),
    meta: { title: "实时降雨" },
    children: [
      {
        path: "/xitongcaozuorizhi",
        component: () =>
          import("../components/page/xitongcaozuorizhi/index.vue"),
        meta: { title: "系统日志" },
      },
      {
        path: "/hetongguanli",
        component: () => import("../components/page/hetongguanli/index.vue"),
        meta: { title: "合同管理" },
      },
      {
        path: "/zijinzifumingxi",
        component: () => import("../components/page/zijinzifumingxi/index.vue"),
        meta: { title: "资金支付明细" },
      },
      {
        path: "/jiliangrenzhengguanli",
        component: () =>
          import("../components/page/jiliangrenzhengguanli/index.vue"),
        meta: { title: "计量认证管理" },
      },
      {
        path: "/shishijiangyu",
        component: () => import("../components/page/shishijiangyu/index.vue"),
        meta: { title: "实时降雨" },
      },
      {
        path: "/canguanjiancha",
        component: () => import("../components/page/canguanjiancha/index.vue"),
        meta: { title: "参观检查" },
      },
      {
        path: "/zhandiankejifuwu",
        component: () =>
          import("../components/page/zhandiankejifuwu/index.vue"),
        meta: { title: "站点科技服务" },
      },
      {
        path: "/waichubanshi",
        component: () => import("../components/page/waichubanshi/index.vue"),
        meta: { title: "外出办事" },
      },
      {
        path: "/qingjia",
        component: () => import("../components/page/qingjia/index.vue"),
        meta: { title: "请假" },
      },
      {
        path: "/chuchai",
        component: () => import("../components/page/chuchai/index.vue"),
        meta: { title: "出差" },
      },
      {
        path: "/qiandao",
        component: () => import("../components/page/qiandao/index.vue"),
        meta: { title: "签到" },
      },
      {
        path: "/tongjifenxi",
        component: () => import("../components/page/tongjifenxi/index.vue"),
        meta: { title: "统计分析" },
      },
      {
        path: "/weixiujilu",
        component: () => import("../components/page/weixiujilu/index.vue"),
        meta: { title: "维修记录" },
      },
      {
        path: "/xunchamingxi",
        component: () => import("../components/page/xunchamingxi/index.vue"),
        meta: { title: "巡查项目" },
      },
      {
        path: "/xunchajilu",
        component: () => import("../components/page/xunchajilu/index.vue"),
        meta: { title: "巡查记录" },
      },
      {
        path: "/shebeiqingdan",
        component: () => import("../components/page/shebeiqingdan/index.vue"),
        meta: { title: "设备清单" },
      },
      {
        path: "/caigoujilu",
        component: () => import("../components/page/caigoujilu/index.vue"),
        meta: { title: "采购记录" },
      },
      /**
       * 考勤打卡管理
       */
      {
        path: "/examSituationManagement",
        component: () =>
          import("../components/page/examSituationManagement/index.vue"),
        meta: { title: "签到管理" },
      },
      {
        path: "/tripManagement",
        component: () => import("../components/page/tripManagement/index.vue"),
        meta: { title: "出差管理" },
      },
      {
        path: "/fundManagement",
        component: () => import("../components/page/fundManagement/index.vue"),
        meta: { title: "资金支付明细" },
      },
      {
        path: "/meteringAuthentication",
        component: () =>
          import("../components/page/meteringAuthentication/index.vue"),
        meta: { title: "计量认证管理" },
      },
      {
        path: "/leaveManagement",
        component: () => import("../components/page/leaveManagement/index.vue"),
        meta: { title: "请假管理" },
      },
      {
        path: "/outgoingManagement",
        component: () =>
          import("../components/page/outgoingManagement/index.vue"),
        meta: { title: "外出办公管理" },
      },
      {
        path: "/procurementRecordMan",
        component: () =>
          import("../components/page/procurementRecordMan/index.vue"),
        meta: { title: "采购记录管理" },
      },
      {
        path: "/techServRecordMan",
        component: () =>
          import("../components/page/techServRecordMan/index.vue"),
        meta: { title: "站点科技服务管理" },
      },
      {
        path: "/visitRecordMan",
        component: () => import("../components/page/visitRecordMan/index.vue"),
        meta: { title: "参观检查管理" },
      },
      {
        path: "/archiveMan",
        component: () => import("../components/page/archiveMan/index.vue"),
        meta: { title: "归档管理" },
      },
      {
        path: "/APPmanagement",
        component: () => import("../components/page/APPmanagement/index.vue"),
        meta: { title: "APP版本管理" },
      },
      {
        path: "/checkDetail",
        component: () =>
          import("../components/page/examSituationManagement/checkDetail.vue"),
        meta: { title: "个人签到详情" },
      },
      {
        path: "/shengtaigongnengpinjia",
        component: () =>
          import("../components/page/shengtaigongnengpinjia/index.vue"),
        meta: { title: "生态功能评价" },
      },
      {
        path: "/zhandiankejifuwu",
        component: () =>
          import("../components/page/zhandiankejifuwu/index.vue"),
        meta: { title: "站点科技服务" },
      },
      {
        path: "/zhandiancailiaoguidang",
        component: () =>
          import("../components/page/zhandiancailiaoguidang/index.vue"),
        meta: { title: "站点材料归档" },
      },
      /**
       * 统计分析
       */
      {
        path: "/statisticalMan",
        component: () => import("../components/page/statisticalMan/index.vue"),
        meta: { title: "降雨量" },
      },
      {
        path: "/jingliunisha",
        component: () =>
          import("../components/page/statisticalMan/jingliunisha.vue"),
        meta: { title: "土壤水分" },
      },
      // {
      //   path: "/tongjifenxiwrap",
      //   component: () => import("../components/page/tongjifenxiwrap/index.vue"),
      //   meta: { title: "统计分析" },
      // },
      {
        name: "shuiwei",
        path: "/shuiwei",
        component: () => import("../components/page/shuiwei/index.vue"),
        meta: { title: "水位" },
      },
      {
        path: "/403",
        component: () => import(/* "403" */ "../components/page/403.vue"),
        meta: { title: "403" },
      },
      {
        path: "/turangshuifen",
        component: () => import("../components/page/turangshuifen/index.vue"),
        meta: { title: "土壤水分" },
      },
    ],
  },
  {
    path: "/login",
    component: () => import("../components/page/Login.vue"),
    meta: { title: "登录" },
  },
  {
    path: "/loadingpage",
    component: () => import("../components/page/loadingpage.vue"),
    meta: { title: "登录" },
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
